﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Lesson15_code1 : MonoBehaviour
{
    public IEnumerator Test()
    {
        print("1");
        yield return 1;     //如果是自带的 开启 那么数字代表等待1帧继续执行后面的内容
        print("2");
        yield return 2;
        print("3");
        yield return 3;
        print("4");
    }

    // Start is called before the first frame update
    void Start()
    {
        //Unity自带的协程协调器 开启协程函数(迭代器函数)
        //StartCoroutine(Test());

        //CoroutineMgr.Instance.MyStartCorutine(Test());
        CoroutineMgr.Instance.MyStartCoroutine(Test());
    }
}
